package com.px.idal;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.px.model.ProjectClass;

public interface IProjectClassMapper {

	/**
	 * 查询方法
	 * 查询所有项目分类
	 * 使用@Select 注解指明getAllUsers方法要执行的SQL
	 * */
	@Select("select * from project_class_tb")
	public List<ProjectClass> getAllProjectClass();

	/**
	 * Insert方法
	 * 增加项目分类
	 * 传参为对象方法
	 * */
	@Insert("INSERT INTO project_class_tb ( project_class_name, project_class_tip ) VALUE(#{project_class_name},#{project_class_tip})")
	public int insertProjectClass(ProjectClass projectClass);

	/**
	 * 查指定ID
	 * 
	 * */
	@Select("select * from project_class_tb where project_class_id=#{project_class_id}")
	public List<ProjectClass> getProjectClassByProjectClassId(ProjectClass projectClass);

	/**
	 * 更新方法
	 * 更新指定project_class_name和project_class_tip的项目分类的密码为project_class_id
	 * 示例
	 * */
	@Update("UPDATE project_class_tb SET project_class_name = #{project_class_name},project_class_tip =#{project_class_tip}where project_class_id=#{project_class_id}")
	public int updateProjectClassByProjectClassId(ProjectClass projectClass);

	/**
	 * 删除方法
	 * 删除指定project_class_id的项目分类
	 * 示例
	 * */
	@Delete("delete from project_class_tb where project_class_id=#{project_class_id}")
	public int deleteProjectClassByProjectClassId(ProjectClass project_class_id);

	/**
	 * 查询项目分类信息总条数
	 * 
	 * */
	@Select("select count(*) from project_class_tb")
	public int getAllProjectClassCounts();

	/**
	 * 查询指定项目分类名项目分类是否存在
	 * 
	 * */
	@Select("select count(*) from project_class_tb where project_class_id=#{project_class_id}")
	public int checkProjectClassIdIsExist(ProjectClass projectClass);

}
